package com.zhoug.common.share;

import android.graphics.Bitmap;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import androidx.annotation.IntDef;

import static java.lang.annotation.RetentionPolicy.SOURCE;

/**
 * 分享参数
 *
 * @Author 35574
 * @Date 2021/9/13
 * @Description
 */
public class ShareParams {

    @IntDef({SHARE_TYPE_IMAGE, SHARE_TYPE_TEXT, SHARE_TYPE_HTML})
    @Retention(SOURCE)
    @Target({ElementType.FIELD, ElementType.PARAMETER})
    public @interface ShareType {
    }

    /**
     * 分享内容类型:图片
     */
    public static final int SHARE_TYPE_IMAGE = 101;
    /**
     * 分享内容类型:文本
     */
    public static final int SHARE_TYPE_TEXT = 102;
    /**
     * 分享内容类型:网页
     */
    public static final int SHARE_TYPE_HTML = 103;

    /**
     * 分享内容类型{@link #SHARE_TYPE_IMAGE,#SHARE_TYPE_TEXT,#SHARE_TYPE_HTML}
     */
    private @ShareType
    int shareType;

    /**
     * 文本分享的内容
     */
    private String text;
    /**
     * 文件分享的路径
     */
    private String filePath;
    /**
     * 图片分享的图片Bitmap 如果同时设置了imageData和filePath优先使用imageData
     */
    private Bitmap imageData;

    /**
     * 保存到本地时的绝对路径
     */
    private String keepLocalPath;


    public int getShareType() {
        return shareType;
    }

    public ShareParams setShareType(int shareType) {
        this.shareType = shareType;
        return this;
    }

    public String getText() {
        return text;
    }

    public ShareParams setText(String text) {
        this.text = text;
        return this;
    }

    public String getFilePath() {
        return filePath;
    }

    public ShareParams setFilePath(String filePath) {
        this.filePath = filePath;
        return this;
    }

    public Bitmap getImageData() {
        return imageData;
    }

    public ShareParams setImageData(Bitmap imageData) {
        this.imageData = imageData;
        return this;
    }

    public String getKeepLocalPath() {
        return keepLocalPath;
    }

    public ShareParams setKeepLocalPath(String keepLocalPath) {
        this.keepLocalPath = keepLocalPath;
        return this;
    }

}
